﻿<navigation:Page xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"  xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
           xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
           xmlns:usercontrols="clr-namespace:AdminModule.UserControls.Common"
           xmlns:viewmodel="clr-namespace:AdminModule.ViewModels"
           x:Class="AdminModule.Views.Main"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Администрирование" Loaded="Page_Loaded">

    <UserControl.Resources>
        <viewmodel:MainVM x:Key="mainVM"/>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>

        <usercontrols:ProgressBar IsVisibility="Collapsed" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="progressBar"></usercontrols:ProgressBar>

        <controls:TreeView x:Name="navigationTreeView" HorizontalAlignment="Left" Grid.Column="0" Margin="0,35,0,0" VerticalAlignment="Top" BorderThickness="0">
            <controls:TreeViewItem Header="Администрирование">
                <controls:TreeViewItem Header="Справочники">
                    <HyperlinkButton Click="indexMarkStructLink_Click" x:Name="indexMarkStructLink" Content="Структура ИС"/>
                    <HyperlinkButton Click="departmentsLink_Click" x:Name="departmentsLink" Content="Структура университета"/>
                    <HyperlinkButton Click="gradationsStructLink_Click" x:Name="gradationsStructLink" Content="Структура градаций"/>
                    <HyperlinkButton Click="categoriesLink_Click" x:Name="categoriesWeightLink" Content="Веса категорий"/>
                    <HyperlinkButton Click="personDegreetLink_Click" x:Name="personDegreetLink" Content="Уч. степени сотрудников"/>

                    <Rectangle Fill="#ffa3c7fc" Height="1" Width="50"></Rectangle>
                    
                    <HyperlinkButton Click="gradationstLink_Click_1" x:Name="gradationstLink" Content="Градации"/>
                    <HyperlinkButton Click="positionsLink_Click" x:Name="positionsLink" Content="Должности"/>
                    <HyperlinkButton Click="unitsLink_Click" x:Name="unitsLink" Content="Единицы измерения"/>
                    <HyperlinkButton Click="categoriesLink_Click_1" x:Name="categoriesLink" Content="Категории"/>
                    <HyperlinkButton Click="departemntsLink_Click" x:Name="departemntsLink" Content="Отделы"/>
                    <HyperlinkButton Click="responsiblesLink_Click" x:Name="responsiblesLink" Content="Ответственные"/>
                    <HyperlinkButton Click="termsLink_Click" x:Name="termsLink" Content="Периоды"/>
                    <HyperlinkButton Click="characteristicsLink_Click" x:Name="characteristicsLink" Content="Показатели"/>
                    <HyperlinkButton Click="jobsLink_Click" x:Name="jobsLink" Content="Работа"/>
                    <HyperlinkButton Click="sectionsLink_Click" x:Name="sectionsLink" Content="Разделы"/>
                    <HyperlinkButton Click="personsLink_Click" x:Name="personsLink" Content="Сотрудники"/>
                    <HyperlinkButton Click="statusesLink_Click" x:Name="statusesLink" Content="Ставки"/>
                    <HyperlinkButton Click="departemntTypesLink_Click" x:Name="departemntTypesLink" Content="Типы отделов"/>
                    <HyperlinkButton Click="degreesLink_Click"  x:Name="degreesLink" Content="Ученые степени"/>
                </controls:TreeViewItem>
                
                <controls:TreeViewItem Header="Журналы">
                    <HyperlinkButton Click="answerLogLink_Click" x:Name="answerLogLink" Content="Ввод данных"/>
                    <HyperlinkButton Click="inputLogLink_Click" x:Name="inputLogLink" Content="Вход в систему"/>
                </controls:TreeViewItem>
                
                <controls:TreeViewItem Header="Импорт">
                    <HyperlinkButton Click="_ImportAnket_Click" x:Name="_ImportAnket" Content="Импорт данных анкетирования"/>
                </controls:TreeViewItem>
            </controls:TreeViewItem>
        </controls:TreeView>

        <controls:GridSplitter Grid.Column="0" Background="#ffa3c7fc" Width="6" BorderBrush="Transparent" BorderThickness="0" Canvas.ZIndex="1" />

        <navigation:Frame x:Name="AdminContentFrame" Grid.Column="1" BorderThickness="0,0,0,0" Padding="0">
            <navigation:Frame.BorderBrush>
                <SolidColorBrush Color="Black"/>
            </navigation:Frame.BorderBrush>
            <navigation:Frame.UriMapper>
                <uriMapper:UriMapper>
                    <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                </uriMapper:UriMapper>
            </navigation:Frame.UriMapper>
        </navigation:Frame>

        <!--<dataInput:Label HorizontalAlignment="Left" Grid.Column="0" Margin="14,8,0,0" VerticalAlignment="Top" Content="Период:"/>-->

        <ComboBox SelectionChanged="termsComboBox_SelectionChanged" Grid.Column="0" ItemsSource="{Binding Terms, Source={StaticResource mainVM}}" x:Name="termsComboBox" HorizontalAlignment="Left" Margin="15,6,0,0" VerticalAlignment="Top" Width="180">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=Start.Year}"></TextBlock>
                        <TextBlock Text="-"></TextBlock>
                        <TextBlock Text="{Binding Path=Stop.Year}"></TextBlock>
                        <TextBlock Text=" ("></TextBlock>
                        <TextBlock Text="{Binding Path=Order}"></TextBlock>
                        <TextBlock Text=", ID: "></TextBlock>
                        <TextBlock Text="{Binding Path=IDTerm}"></TextBlock>
                        <TextBlock Text=")"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
    </Grid>
</navigation:Page>
